home *** CD-ROM | disk | FTP | other *** search
/ CD School House 9 / CD School House 9.0 - Wayzata Technology (1994).iso / pc / dos / teachaid / babydos / chapt1 < prev    next >
Text File  |  1994-06-08  |  6KB  |  194 lines

  1.  
  2.                               CHAPTER 1
  3.  
  4.                    INTRODUCTION TO BATCH (BAT) FILES
  5.  
  6.             Batch File commands are the most powerful and
  7.             versatile of the DOS commands.  Writing Batch Files
  8.             is the best way to learn how to use the DOS commands.
  9.  
  10.             In the next lessons you will write many Batch Files.
  11.             You'll have an opportunity to see these Batch files
  12.             come alive with the Menus, Programs and color
  13.             combinations. You'll experience a sense of power
  14.             that you have over the computer.
  15.  
  16.             This is a real accomplishment to learn one of
  17.             the most powerfuQl and useful parts of DOS. You'll be
  18.             one of the few persons who'll know how to write a
  19.             Batch File, a Program and a Menu---and in color.   
  20.  
  21.        └─  HOW TO WRITE BATCH FILES
  22.             BATCH (BAT) FILE
  23.             Bat (short for Batch File) is not a DOS command,
  24.             but a file that is created with the Copy Command. It
  25.             has special powers given to it by DOS. Bat Files can
  26.             instruct the computer (DOS)) to carry out commands.
  27.  
  28.             Batch File commands can make the computer (DOS)
  29.             create Menu-Driven-Programs;  automate many DOS
  30.             functions; beep;  blink;  change colors;  show you
  31.             what's in a file;  print a file, and perform many other
  32.             functions. 
  33.  
  34.        └─  GETTING STARTED
  35.             To do the Lessons from this disk or from the
  36.             Manual, you must first format a disk with the System
  37.             files so it will start your computer.
  38.  
  39.        └─  FORMATTING A DISK
  40.             If you have only one disk drive, type the following
  41.             next to the A> prompt:
  42.  
  43.                         Format A:/S         <Press Enter key>
  44.  
  45.             The computer will instruct you on what to do.
  46.  
  47.             If you have two disk drives, insert your DOS disk
  48.             into drive A. Insert a Blank disk into drive B:.
  49.             Now type the following next to the A prompt:
  50.  
  51.                         Format B:/S
  52.  
  53.             When formatting is complete remove both disks.
  54.             Insert your formatted disk (from drive B>)
  55.             into the A> drive.
  56.             
  57.        └─  THE COPY COMMAND
  58.             The most versatile DOS command is the Copy command.
  59.             With the Copy command all sorts of Batch Files can
  60.             be created. The Batch Files being a special DOS file
  61.             can give the computer all sorts of commands
  62.  
  63.                                -3-
  64.  
  65.  
  66.  
  67.  
  68.             from copying a file to formatting a disk.
  69.             In this lesson the interest is in writing Batch Files,
  70.             Programs and Menus. All of which the Batch File
  71.             does very well.
  72.  
  73.             You'll first write a simple Batch File that will tell
  74.             the computer to show you all the files (contents) of the
  75.             directory of the disk in drive A.
  76.  
  77.             Check to see that your formatted disk is in the A> disk drive.
  78.  
  79.        └─  WRITING THE FIRST BATCH FILE
  80.             ▀  With your formatted disk in the disk drive, type the following
  81.                next to the A:\> Prompt, like this:
  82.                     Copy Con First.Bat
  83.                     A:
  84.                     Dir
  85.                     Press F6 key,   <then press Enter key>
  86.                    -------------
  87.  
  88.        └─  THE BAT FILE ABOVE TELLS US:
  89.             ▀ That the first line contains the Copy command and
  90.               the name of the Bat file  (First).
  91.             ▀ The next word after Copy is "Con" which  stands
  92.               for CONsole (keyboard). Con instructs the Copy command
  93.               to copy from the keyboard what you are about to write.
  94.  
  95.             ▀ The second line "A:" stands for the A drive. This tells
  96.               the computer that you are working with the disk in
  97.               the A drive.
  98.             ▀ The third line tells the computer that you wish to see
  99.               on the screen the contents of the directory that is on
  100.               the disk in the A drive.
  101.             ▀ Line four is the Function key F6 (large key on top
  102.               row) that tells the computer (DOS) that you are
  103.               finished writing the Batch File.
  104.             All that is left now is to strike the Enter key.
  105.             The Batch file will be saved on the disk in the A> drive.
  106.  
  107.           Now you will write four Batch files that will be used
  108.          to change the screen color (Background) to Blue or Red and
  109.          the letters to White or Yellow. You'll then display the
  110.          files in the A: directory.
  111.  
  112.    └─  WRITING THE FIRST COLOR BATCH-FILE  (BB.Bat)
  113.             (BB.Bat.. Blue Screen...also called Background)
  114.             Type the following next to the A:\> Prompt, like this:
  115.  
  116.                         Copy Con BB.Bat
  117.                         BB.Bat
  118.                         Dir
  119.                         Press F6 key, then press Enter key.
  120.                        -------------
  121.  
  122.     └─  WRITING THE SECOND COLOR BATCH-FILE  (W.Bat)
  123.         (W.Bat..White letters... also called Foreground)
  124.  
  125.  
  126.  
  127.  
  128.                                   -4-
  129.  
  130.  
  131.  
  132.  
  133.  
  134.         Type the following next to the A> Prompt, like this:
  135.  
  136.                         Copy Con W.Bat
  137.                         W.Bat
  138.                         Dir
  139.                         Press F6 key, then press Enter key.
  140.                        -------------
  141.  
  142.    └─  WRITING THE THIRD COLOR BATCH-FILE  (Y.Bat)
  143.         (Y.Bat.. Yellow letters)
  144.         Type the following next to the A> Prompt. like this:
  145.  
  146.                         Copy Con Y.Bat
  147.                         Y.Bat
  148.                         Dir
  149.                         Press F6 key, then press Enter key.
  150.                        -------------
  151.  
  152.     └─ WRITING THE FOURTH COLOR BATCH-FILE  (RB.Bat)
  153.         (RB.Bat.. Red background)
  154.  
  155.                         Copy Con RB.Bat
  156.                         RB.Bat
  157.                         Dir
  158.                         Press F6 key, then press Enter key.
  159.                        -------------
  160.  
  161.         We'll now go to Chapter 2 and see the Color Codes
  162.         for the 8 foreground and 8 background colors.
  163.  
  164.         (8 X 8 =64 possible color combinations)
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.                                   -5-
  194.